<?php
/**
 * Created by PhpStorm.
 * User: coolinmind
 * Date: 28/11/2018
 * Time: 11:26
 */

namespace App\Services\Mobile;


use App\Services\ProjectValidate;

class ValidateAuth extends ProjectValidate
{

    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
        // TODO: Implement initValidate() method.
    }

    public $rules = [
        'id'         => 'required',
        'name'       => 'required',
        'password'   => 'required',
        'real_name'  => 'required|string|max:5|min:2',
        'phone'      => 'required|regex:/^1[34578][0-9]{9}$/',
        'stage_name' => 'string',
        'provice'    => 'required|string',
        'major'      => 'required|int|in:1,2,3,4,5',
    ];


    public $messages = [

    ];

    /**
     * @var array 上面规则中定义的 key 的名字
     */
    public $attributes = [
        'name'       => '用户名',
        'password'   => '密码',
        'real_name'  => '真实姓名',
        'phone'      => '手机号码',
        'stage_name' => '艺名',
        'provice'    => '省市',
        'major'      => '专业',
    ];
}